package net.crazyadam.audio;

import org.hermit.dsp.Window;

/**
 * Copyright by <a href="http://crazyadam.net"><em><i>Joseph J.C. Tang</i></em></a> <br/>
 * Email: <a href="mailto:jinntrance@gmail.com">jinntrance@gmail.com</a>
 *
 * @author joseph
 * @version 1.0
 * @since 9/26/12 3:47 PM
 */
public class Constant {
    public static final String NORMAL_FREQUENCY_WIDTH="NormalWidth";
    public static final String MAX_FREQUENCY_WIDTH="MaxWidth";
    public static final String WINDOW_FUNCTION="BLACKMAN_HARRIS";
    public static final int FREQUENCY=18000;
    public static final int SAMPLE_RATE=44100;
    public static final int BLOCK_SIZE = 1024;
    public static final int DECIMATION = 2;
    public static final int AVERAGE_LEN = 4;
    public static final Window.Function windowFunc =Window.Function.BLACKMAN_HARRIS;
    public static int kFloatToByteShift=128;
    public static double complexThreshold=0.009;
    public static double modulationThreshold=700;

    public static long waitingTime(){
        Double time=Math.floor(1000/(SAMPLE_RATE*1.0/BLOCK_SIZE));
        return time.longValue();
    }
}
